﻿using DX_Recognize.Entitys;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static DX_Recognize.Utils.ConvertUtils;

namespace DX_Recognize.PageView
{
    public partial class PullingWindow : Form
    {
        public PullingWindow()
        {
            InitializeComponent();
            this.Hide();
        }

        public event Action<PullingPushType> PullingAction;

        public void ShowDialog()
        {
            if (this.WindowState == FormWindowState.Minimized)
                this.WindowState = FormWindowState.Normal;
            this.Show();
        }

        private void PullingWindow_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            e.Cancel = true;
        }

        private void Cancelbtn_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void ComfirmBtn_Click(object sender, EventArgs e)
        {
            PullingPushType pullingType = PullingPushType.None;
            if (AsUsualBtn.Checked)
                pullingType = PullingPushType.AsUsual;
            if (StandardSupBtn.Checked)
                pullingType = PullingPushType.StandardSup;
            if (wholeRepBtn.Checked)
                pullingType = PullingPushType.wholeRep;
            PullingAction?.Invoke(pullingType);
            this.Hide();
        }
    }
}
